<?php
$this->breadcrumbs=array(Lang::t('admin.list.page.title'));
?>

<div class="page-nav text-right">
    <a href="<?php echo $this->addNewUrl; ?>" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Add New</a>
</div>
<!--<div class="alert alert-info"><?php echo Lang::t('admin.list.form.note'); ?></div>-->
<?php $this->getFlashes(array('class'=>'alert alert-{status}')); ?>
<?php //$this->widget('AdvancedSearchWidget', array('formView' => '_search', 'user' => $model, 'address'=>$address)); ?>
<?php
$this->widget('ext.extended.GridView', array(
    'id' => 'grid',
    'dataProvider' => $dataProvider,
    'filter' => $model,
    'rowHtmlOptionsExpression'=>implode('; ', array(
        '$data->defaultImage=array(
            Option::GENDER_FEMALE=>"'.$this->imagesPath.'/female-small.png",
            Option::GENDER_MALE=>"'.$this->imagesPath.'/male-small.png",)',
    )),
    'htmlOptions'=>array(
        'class'=>'table-responsive',
    ),
    'itemsCssClass'=>'table table-hover',
    'dropDowns' => array(
        'sort' => array(
            'label' => 'Sort by',
            'dropDownVar' => 'sort_',
            'cssClass'=>'sort',
            'items' => array(
                'firstName_' => 'Firstname ASC',
                'firstName_.desc' => 'Firstname DESC',
                'email_' => 'Email ASC',
                'email_.desc' => 'Email DESC',
            ),
        ),
        'pageSize' => array(
            'label' => 'Results per page',
            'dropDownVar' => 'pageSize_',
            'cssClass'=>'page-size',
            'default' => 10,
            'items' => array(
                10 => 10,
                20 => 20,
                50 => 50,
                80 => 80,
                100 => 100,
            ),
        ),
    ),
    'columns' => array(
        array(
            'header'=>Lang::t('user.profile.lbl.id'),
            'filterHtmlOptions'=>array('class'=>'id-filter'),
            'name' => 'id_',
            'value' => '$data->id',
            'htmlOptions' => array('class' => 'id-column'),
        ),
        array(
            'name' => 'avatar_',
            'filter' => false,
            'type'=>'image',
            'value'=>'$data->avatar',
            'htmlOptions'=>array(
                'class' => 'grid-image',
            ),
        ),
        array(
            'name' => 'name_',
            'value' => '$data->fullName',
            'htmlOptions'=>array(
                'style'=>'width:200px;',
            ),
        ),
        array(
            'name' => 'gender_',
            'value' => '$data->gender',
            'filter' => $model->genderOption,
            'htmlOptions'=>array(
                'style'=>'width:50px; text-align:center;',
            ),
        ),
        array(
            'name' => 'userRole_',
            'value' => '$data->role',
            'filter' => $model->adminRoleOption,
            'htmlOptions'=>array(
                'style'=>'width:100px; text-align:center;',
            ),
        ),
        array(
            'name' => 'mobileNumber_',
            'value' => '$data->contactNumber',
            'htmlOptions'=>array(
                'style'=>'width:100px;',
            ),
        ),
        array(
            'name' => 'email_',
            'type' => 'email',
            'value' => '$data->email',
        ),
        array(
            'name' => 'status_',
            'value' => '$data->status',
            'filter' => $model->statusOption,
            'htmlOptions'=>array(
                'style'=>'width:100px; text-align:center;',
            ),
        ),
        array(
            'class' => 'CButtonColumn',
            //'template'=>'{delete}&nbsp;&nbsp;{update}',
            'deleteConfirmation' => Lang::t('admin.list.delete.confirmation', array('{id}'=>$model->id)),
        ),
        array(
            'class' => 'CCheckBoxColumn',
            'selectableRows' => 2,
        ),
    ),
));
?>